<?php
class MY_Controller extends CI_Controller{
	
	private $log;
	function __construct(){
		$this->log=Logger::getRootLogger();
		parent::__construct();
	}
	public  function stdClass_to_array($stdClass){
		$json=json_encode($stdClass);
		return json_decode($json,true);
	}
	public function query_result_to_array($query){
		$result=array();
		if(!empty($query)){
			foreach ($query->result_array() as $row){
				array_push($result,$row);
			}
		}
		return $result;
	}
	public function get_Mycarts(){
		return $this->db->query('select * from carts');
	}
}